GISUSDB:=gisusdb

GISUSDB_BASEDIR:=$(BASEDIR)/$(GISUSDB)

GISUSDB_CC:=g++
GISUSDB_LD:=g++

GISUSDB_MODULES_DEPENDENCIES:=mydb myfile mythread

GISUSDB_INCFLAGS:=-I$(GISUSDB_BASEDIR)/inc -I$(BASEDIR)/common/inc $(patsubst %, -I$(BASEDIR)/%/inc, $(GISUSDB_MODULES_DEPENDENCIES))

ifeq ($(SYSTEM), MINGW32_NT-5.1)
GISUSDB_DEBUG_CFLAGS:=-g -Wall -W -pedantic -Woverloaded-virtual -D_REENTRANT -DDEBUG $(GISUSDB_INCFLAGS)
GISUSDB_DEBUG_LDFLAG:=
GISUSDB_DEBUG_LIBS:=

GISUSDB_RELEASE_CFLAGS:=-Wall -W -pedantic -Woverloaded-virtual -D_REENTRANT -DRELEASE $(GISUSDB_INCFLAGS)
GISUSDB_RELEASE_LDFLAG:=
GISUSDB_RELEASE_LIBS:=

GISUSDB_SCRAMBLED_CFLAGS:=-Wall -W -pedantic -Woverloaded-virtual -D_REENTRANT -DRELEASE -DSCRAMBLE_SYMBOLS $(GISUSDB_INCFLAGS)
GISUSDB_SCRAMBLED_LDFLAG:=
GISUSDB_SCRAMBLED_LIBS:=
endif

ifeq ($(SYSTEM), Linux)
GISUSDB_DEBUG_CFLAGS:=-g -Wall -W -pedantic -Woverloaded-virtual -D_REENTRANT -DDEBUG $(GISUSDB_INCFLAGS)
GISUSDB_DEBUG_LDFLAG:=
GISUSDB_DEBUG_LIBS:=

GISUSDB_RELEASE_CFLAGS:=-Wall -W -pedantic -Woverloaded-virtual -D_REENTRANT -DRELEASE $(GISUSDB_INCFLAGS)
GISUSDB_RELEASE_LDFLAG:=
GISUSDB_RELEASE_LIBS:=

GISUSDB_SCRAMBLED_CFLAGS:=-Wall -W -pedantic -Woverloaded-virtual -D_REENTRANT -DRELEASE -DSCRAMBLE_SYMBOLS $(GISUSDB_INCFLAGS)
GISUSDB_SCRAMBLED_LDFLAG:=
GISUSDB_SCRAMBLED_LIBS:=

endif

GISUSDB_SRC:=$(shell ls 2>&1 $(GISUSDB_BASEDIR)/src/*.cpp)

TMP_GISUSDB_OBJ:= $(patsubst %.cpp,%.o,$(filter %.cpp,$(GISUSDB_SRC)))
TMP_GISUSDB_DEP:= $(patsubst %.cpp,%.d,$(filter %.cpp,$(GISUSDB_SRC)))

SRC+=$(GISUSDB_SRC)

GISUSDB_DEBUG_OBJS=$(shell echo $(TMP_GISUSDB_OBJ) | sed -e 's@src@obj/debug@g' )
GISUSDB_RELEASE_OBJS+=$(shell echo $(TMP_GISUSDB_OBJ) | sed -e 's@src@obj/release@g' )
GISUSDB_SCRAMBLED_OBJS+=$(shell echo $(TMP_GISUSDB_OBJ) | sed -e 's@src@obj/scrambled@g' )

DEBUG_OBJS+=$(GISUSDB_DEBUG_OBJS)
RELEASE_OBJS+=$(GISUSDB_RELEASE_OBJS)
SCRAMBLED_OBJS+=$(GISUSDB_SCRAMBLED_OBJS)

# Dependencies are release independant.
DEPS+=$(shell echo $(TMP_GISUSDB_DEP) | sed -e 's@src@dep@g' )

DEBUG_GISUSDB_ARCHIVE:=$(BASEDIR)/lib/debug/$(GISUSDB).a
RELEASE_GISUSDB_ARCHIVE:=$(BASEDIR)/lib/release/$(GISUSDB).a
SCRAMBLED_GISUSDB_ARCHIVE:=$(BASEDIR)/lib/scrambled/$(GISUSDB).a

DEBUG_ARCHIVES+=$(DEBUG_GISUSDB_ARCHIVE)
RELEASE_ARCHIVES+=$(RELEASE_GISUSDB_ARCHIVE)
SCRAMBLED_ARCHIVES+=$(SCRAMBLED_GISUSDB_ARCHIVE)
